package com.ruoyi.eqmonitor.config;

import org.apache.iotdb.session.pool.SessionPool;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class IotDBSessionConfig {

    @Value("${spring.iotdb.username}")
    private String userName;

    @Value("${spring.iotdb.password}")
    private String password;

    @Value("${spring.iotdb.ip}")
    private String ip;

    @Value("${spring.iotdb.port}")
    private int port;

    @Value("${spring.iotdb.maxSize}")
    private int maxSize;

    @Bean
    public SessionPool getSessionPool() {
       return new SessionPool(ip, port, userName, password, maxSize);
    }

}
